#ifndef _EVENTDISPATCHER_H_
#define _EVENTDISPATCHER_H_

#include <SECore/Event.h>
#include <SECore/Events/QuitEvent.h>

namespace SEngine
{
    class EventDispatcher final
    {
    public:
        EventDispatcher(EventPtr e) : m_event(e) {}
        template<typename T>
        void Dispatcher(std::function<void(std::shared_ptr<T>)> && fn) {
            if (m_event->Type() == typeid(T).hash_code()) {
                fn(std::dynamic_pointer_cast<T>(m_event));
            }
        }
    private:
        EventPtr m_event;
    };
} // namespace SEngine


#endif